<template>
  <div class="container">
    <!-- <Breadcrumb :items="['数据分析', '政府服务数据统计']" /> -->
    <a-card class="general-card" style="padding-top:20px">
      <!-- <a-row>
        <a-col :flex="1">
          <a-form :model="formModel" label-align="right">
            <a-row :gutter="16">
              <a-space direction="horizontal" :size="5">
                <a-form-item field="userName" label-col-flex="75px" label="统计县市区">
                  <a-select v-model="formModel.area.value" :style="{ width: '150px' }"
                    :trigger-props="{ autoFitPopupMinWidth: true }">
                    <a-option value="市本级">市本级</a-option>
                    <a-option value="黄州区">黄州区</a-option>
                    <a-option value="团风县">团风县</a-option>
                    <a-option value="红安县">红安县</a-option>
                    <a-option value="麻城市">麻城市</a-option>
                    <a-option value="罗田县">罗田县</a-option>
                    <a-option value="英山县">英山县</a-option>
                    <a-option value="浠水县">浠水县</a-option>
                    <a-option value="蕲春县">蕲春县</a-option>
                    <a-option value="武穴市">武穴市</a-option>
                    <a-option value="黄梅县">黄梅县</a-option>
                  </a-select>
                </a-form-item>

               
                
                <a-form-item field="staticType" label-col-flex="60px" label="统计类型">
                  <a-select v-model="formModel.staticType.value" :style="{ width: '150px' }"
                    :trigger-props="{ autoFitPopupMinWidth: true }">
                    <a-option :value="1">年度统计</a-option>
                    <a-option :value="2">季度统计</a-option>
                    <a-option :value="3">月度统计</a-option>
                  </a-select>
                </a-form-item>
                <a-form-item field="year" v-if="formModel.staticType.value == '1'" label-col-flex="60px" label="统计年度">
                  <a-year-picker style="width: 150px;" />
                </a-form-item>
                <a-form-item field="quarter" v-else-if="formModel.staticType.value == '2'" label-col-flex="60px"
                  label="统计季度">
                  <a-quarter-picker style="width: 150px;" />
                </a-form-item>
                <a-form-item field="month" v-else-if="formModel.staticType.value == '3'" label-col-flex="60px"
                  label="统计月度">
                  <a-month-picker style="width: 150px;" />
                </a-form-item>
                <a-form-item label-col-flex="0px" label="">
                  <a-space direction="horizontal" :size="12">
                    <a-button status="success">
                      <template #icon>
                        <icon-search />
                      </template>
                      查询
                    </a-button>
                    <a-button type="primary" status="warning" @click="addDataShowFun">
                      <template #icon>
                        <icon-plus />
                      </template>
                      新建
                    </a-button>
                    
                    <a-button @click="leadAddShow">
                      <template #icon>
                        <icon-upload />
                      </template>
                      批量导入
                    </a-button>

                    <a-button @click="jumpDowmTemp">
                      <template #icon>
                        <icon-download />
                      </template>
                      下载
                    </a-button>
                  </a-space>
                </a-form-item>
              </a-space>
            </a-row>
          </a-form>
        </a-col>
      </a-row> -->
      <a-table :data="renderData" :pagination="false" :bordered="false" :scrollbar="true"
        :scroll="{ x: '1600px', y: '110' }">
        <template #columns>
          <!-- <a-table-column title="统计年月" align="center" data-index="statisticalYear" :width="120">
            <template #cell="{ record }">
              <span v-if="record.statisticalTimeType == '1'">
                {{ record.statisticalYear }}年
              </span>
              <span v-else-if="record.statisticalTimeType == 2">
                {{ record.statisticalYear }}-Q{{ record.statisticalQuarter }}季
              </span>
              <span v-else-if="record.statisticalTimeType == 3">
                {{ record.statisticalYear }}-{{ record.statisticalMonth }}月
              </span>
            </template>
          </a-table-column> -->
          <!-- <a-table-column title="统计季度" align="center" data-index="statisticalMonth" :width="100">
                  </a-table-column>
                  <a-table-column title="统计月度" align="center" data-index="statisticalDay" :width="100">
                  </a-table-column> -->
          <a-table-column title="统计县市区" align="center" data-index="area" :width="110">
          </a-table-column>
          <!-- <a-table-column title="产业行业" align="center" data-index="industryCatalog" :width="100">
            <template #cell="{ record }">
              <span v-if="record.industryCategory == null">
                全部
              </span>
              <span v-else>
                {{ record.industryCategory }}
              </span>
            </template>
          </a-table-column> -->
          <a-table-column title="实际办理总量" align="center" data-index="quantity" :width="110">
          </a-table-column>
          <a-table-column title="i黄冈办理总量" align="center" data-index="iquantity" :width="110">
          </a-table-column>
          <a-table-column title="i黄冈线上办理率" align="center" data-index="iamount" :width="110">
          </a-table-column>
          <a-table-column title="全市排位" align="center" data-index="iRank" :width="110">
          </a-table-column>
          <!-- <a-table-column title="i黄冈办理涉及的金额（万元）" align="center" data-index="iamount" :width="110">
          </a-table-column> -->
          <!-- <a-table-column title="省增速" align="center" data-index="amount" :width="100">
          </a-table-column>
          <a-table-column title="市增速" align="center" data-index="amount" :width="110">
          </a-table-column> -->
          <!-- <a-table-column title="贡献率" align="center" data-index="iamount" :width="110">
          </a-table-column> -->
          <!-- <a-table-column title="拉动率" align="center" data-index="pullingRate" :width="110">
          </a-table-column> -->
          <a-table-column title="统计部门" align="center" data-index="entryDepartment" :width="100">
          </a-table-column>
          <a-table-column title="操作" align="center" :width="100" fixed="right">
            <template #cell="{ record }">
              <a-button type="outline" status="warning" shape="round" size="mini" @click="editItem(record)">
                <template #default>编辑</template>
              </a-button>
            </template>
          </a-table-column>
        </template>
      </a-table>
      <a-pagination show-total show-jumper :total="totalSize" style="margin-top: 8px;" />
    </a-card>

    <!-- 侧边新增数据 -->
    <a-drawer :width="680" :visible="addvisible" @before-ok="handleAddOk" @cancel="handleCancel" unmountOnClose>
      <template #title>
        新增GDP数据
      </template>
      <div>
        <a-form :model="addDataForm" layout="vertical" label-align="right">
          <a-row>
            <a-col :span="12">
              <a-form-item field="area" label-col-flex="100px" label="县市区" required>
                <a-select v-model="addDataForm.area.value" placeholder="请选择" :style="{ width: '300px' }">
                  <a-option value="市本级">市本级</a-option>
                  <a-option value="黄州区">黄州区</a-option>
                  <a-option value="团风县">团风县</a-option>
                  <a-option value="红安县">红安县</a-option>
                  <a-option value="麻城市">麻城市</a-option>
                  <a-option value="罗田县">罗田县</a-option>
                  <a-option value="英山县">英山县</a-option>
                  <a-option value="浠水县">浠水县</a-option>
                  <a-option value="蕲春县">蕲春县</a-option>
                  <a-option value="武穴市">武穴市</a-option>
                  <a-option value="黄梅县">黄梅县</a-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :span="12">
            </a-col>
            <a-col :span="12">
              <a-form-item field="statisticalTimeType" label-col-flex="100px" label="统计类型" required>
                <a-select v-model="addDataForm.statisticalTimeType.value" :style="{ width: '300px' }"
                  :trigger-props="{ autoFitPopupMinWidth: true }">
                  <a-option :value="1">年度统计</a-option>
                  <a-option :value="2">季度统计</a-option>
                  <a-option :value="3">月度统计</a-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item
                v-if="addDataForm.statisticalTimeType.value == 1" 
                label-col-flex="100px" label="统计年度"
                required>
                <a-year-picker v-model="addDataForm.statisticalYear.value"  style="width: 300px;" />
              </a-form-item>
              <a-form-item v-if="addDataForm.statisticalTimeType.value == 2" label-col-flex="100px" label="统计季度"
                required>
                <a-quarter-picker v-model="addDataForm.statisticalQuarter.value" style="width: 300px;" />
              </a-form-item>
              <a-form-item v-if="addDataForm.statisticalTimeType.value == 3" label-col-flex="100px" label="统计月度"
                required>
                <a-month-picker v-model="addDataForm.statisticalMonth.value" style="width: 300px;" />
              </a-form-item>
            </a-col>
            <!-- <a-col :span="12">
              <a-form-item field="industry" label-col-flex="100px" label="产业类型">
                <a-select v-model="addDataForm.industry.value" :style="{ width: '300px' }">
                  <a-option value="第一产业">第一产业</a-option>
                  <a-option value="第二产业">第二产业</a-option>
                  <a-option value="第三产业">第三产业</a-option>
                </a-select>
              </a-form-item>
            </a-col> -->
            <a-col :span="12">
              <a-form-item field="industryCategory" label-col-flex="100px" label="行业类型">
                <a-select v-model="addDataForm.industryCategory.value" :style="{ width: '300px' }">
                  <a-option value="农林牧渔">农林牧渔</a-option>
                  <a-option value="工业">工业</a-option>
                  <a-option value="建筑业">建筑业</a-option>
                  <a-option value="批发和零售业">批发和零售业</a-option>
                  <a-option value="交通运输仓储和邮政业">交通运输业</a-option>
                  <a-option value="住宿和餐饮业">住宿和餐饮业</a-option>
                  <a-option value="金融业">金融业</a-option>
                  <a-option value="房地产业">房地产业</a-option>
                  <a-option value="其他服务业">其他服务业</a-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="gdp" label-col-flex="100px" label="总量(亿元)" required>
                <a-input-number v-model="addDataForm.gdp.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="ranking" label-col-flex="100px" label="总量排名" required>
                <a-input-number v-model="addDataForm.ranking.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="growthGdp" label-col-flex="100px" label="增量(亿元)" required>
                <a-input-number v-model="addDataForm.growthGdp.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="iquantity" label-col-flex="100px" label="增量排名" required>
                <a-input-number v-model="addDataForm.iquantity.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="perCapitaValue" label-col-flex="100px" label="GDP增速" required>
                <a-input-number v-model="addDataForm.perCapitaValue.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="perCapitaRanking" label-col-flex="100px" label="增速排名" required>
                <a-input-number v-model="addDataForm.perCapitaRanking.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="iamount" label-col-flex="100px" label="贡献率" required>
                <a-input-number v-model="addDataForm.iamount.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="iiquantity" label-col-flex="100px" label="贡献率排名" required>
                <a-input-number v-model="addDataForm.iiquantity.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="pullingRate" label-col-flex="100px" label="拉动率" required>
                <a-input-number v-model="addDataForm.pullingRate.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="pullingRateRanking" label-col-flex="100px" label="拉动率排名" required>
                <a-input-number v-model="addDataForm.pullingRateRanking.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            
            <a-col :span="12">
              <a-form-item field="entryDepartment" label-col-flex="100px" label="统计部门" required>
                  <a-input v-model="addDataForm.entryDepartment.value" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>

            <a-col :span="12">
              <a-form-item field="creator" label-col-flex="100px" label="填报人" required>
                  <a-input v-model="addDataForm.creator.value" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
          </a-row>

        </a-form>
      </div>
    </a-drawer>

    
    <!-- 侧边新增数据 -->
    <a-drawer :width="680" :visible="editvisible" @before-ok="handleEditOk" @cancel="editvisible=false" unmountOnClose>
      <template #title>
        修改GDP数据
      </template>
      <div>
        <a-form :model="editDataForm" layout="vertical" label-align="right">
          <a-row>
            <a-col :span="12">
              <a-form-item field="area" label-col-flex="100px" label="县市区" required>
                <a-select v-model="editDataForm.area.value" placeholder="请选择" :style="{ width: '300px' }">
                  <a-option value="市本级">市本级</a-option>
                  <a-option value="黄州区">黄州区</a-option>
                  <a-option value="团风县">团风县</a-option>
                  <a-option value="红安县">红安县</a-option>
                  <a-option value="麻城市">麻城市</a-option>
                  <a-option value="罗田县">罗田县</a-option>
                  <a-option value="英山县">英山县</a-option>
                  <a-option value="浠水县">浠水县</a-option>
                  <a-option value="蕲春县">蕲春县</a-option>
                  <a-option value="武穴市">武穴市</a-option>
                  <a-option value="黄梅县">黄梅县</a-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :span="12">
            </a-col>
            <a-col :span="12">
              <a-form-item field="staticType" label-col-flex="100px" label="统计类型" required>
                <a-select v-model="editDataForm.statisticalTimeType.value" :style="{ width: '300px' }"
                  :trigger-props="{ autoFitPopupMinWidth: true }">
                  <a-option :value="1">年度统计</a-option>
                  <a-option :value="2">季度统计</a-option>
                  <a-option :value="3">月度统计</a-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="statisticalYear" v-if="editDataForm.statisticalTimeType.value == 1" label-col-flex="100px" label="统计年度"
                required>
                <a-year-picker style="width: 300px;" />
              </a-form-item>
              <a-form-item field="statisticalYear" v-if="editDataForm.statisticalTimeType.value == 2" label-col-flex="100px" label="统计季度"
                required>
                <a-quarter-picker style="width: 300px;" />
              </a-form-item>
              <a-form-item field="statisticalYear" v-if="editDataForm.statisticalTimeType.value == 3" label-col-flex="100px" label="统计月度"
                required>
                <a-month-picker style="width: 300px;" />
              </a-form-item>
            </a-col>
            <!-- <a-col :span="12">
              <a-form-item field="industry" label-col-flex="100px" label="产业类型">
                <a-select v-model="editDataForm.industry.value" :style="{ width: '300px' }">
                  <a-option value="第一产业">第一产业</a-option>
                  <a-option value="第二产业">第二产业</a-option>
                  <a-option value="第三产业">第三产业</a-option>
                </a-select>
              </a-form-item>
            </a-col> -->
            <a-col :span="12">
              <a-form-item field="industryCategory" label-col-flex="100px" label="行业类型">
                <a-select v-model="editDataForm.industryCategory.value" :style="{ width: '300px' }">
                  <a-option value="农林牧渔">农林牧渔</a-option>
                  <a-option value="工业">工业</a-option>
                  <a-option value="建筑业">建筑业</a-option>
                  <a-option value="批发和零售业">批发和零售业</a-option>
                  <a-option value="交通运输仓储和邮政业">交通运输业</a-option>
                  <a-option value="住宿和餐饮业">住宿和餐饮业</a-option>
                  <a-option value="金融业">金融业</a-option>
                  <a-option value="房地产业">房地产业</a-option>
                  <a-option value="其他服务业">其他服务业</a-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="gdp" label-col-flex="100px" label="总量(亿元)" required>
                <a-input-number v-model="editDataForm.gdp.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="ranking" label-col-flex="100px" label="总量排名" required>
                <a-input-number v-model="editDataForm.ranking.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="growthGdp" label-col-flex="100px" label="增量(亿元)" required>
                <a-input-number v-model="editDataForm.growthGdp.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="iquantity" label-col-flex="100px" label="增量排名" required>
                <a-input-number v-model="editDataForm.iquantity.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="perCapitaValue" label-col-flex="100px" label="GDP增速" required>
                <a-input-number v-model="editDataForm.amount.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="perCapitaRanking" label-col-flex="100px" label="增速排名" required>
                <a-input-number v-model="editDataForm.iquantity.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="iamount" label-col-flex="100px" label="贡献率" required>
                <a-input-number v-model="editDataForm.iamount.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="iiquantity" label-col-flex="100px" label="贡献率排名" required>
                <a-input-number v-model="editDataForm.iiquantity.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="pullingRate" label-col-flex="100px" label="拉动率" required>
                <a-input-number v-model="editDataForm.pullingRate.value" :precision="2" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item field="pullingRateRanking" label-col-flex="100px" label="拉动率排名" required>
                <a-input-number v-model="editDataForm.pullingRateRanking.value" :precision="0" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
            
            <a-col :span="12">
              <a-form-item field="entryDepartment" label-col-flex="100px" label="统计部门" required>
                  <a-input v-model="editDataForm.entryDepartment.value" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>

            <a-col :span="12">
              <a-form-item field="creator" label-col-flex="100px" label="填报人" required>
                  <a-input v-model="editDataForm.creator.value" :style="{ width: '300px' }" />
              </a-form-item>
            </a-col>
          </a-row>

        </a-form>
      </div>
    </a-drawer>


    <a-modal v-model:visible="toLeadVisible" @ok="toLeadOk" width="420px" title="表格导入">
      <a-row>
          <a-upload style="margin: 10px 20px;" action="/" draggable class="uploadDiv" accept=".xls,.xlsx"
              :auto-upload="false" :limit="1" ref="uploadRef" @change="onFileChange">
          </a-upload>

          <p style="margin-left: 70px;">仅允许导入 xls、xlsx 格式文件。
              <a-link @click="jumpDowmTemp">
                  <template #icon>
                      <icon-edit />
                  </template>
                  下载模板
              </a-link>
          </p>
      </a-row>
  </a-modal>

  </div>
</template>
<script lang="ts" setup>
import { ref, reactive } from 'vue';
import { Modal, Message } from '@arco-design/web-vue';
import { postRequest, uploadFileRequest } from '@/api/common';
import { baseURL } from '@/api/base';
const formModel = {
  area: ref(""),
  industryCategory: ref(""),
  industry: ref(""),
  staticType: ref(""),
  year: ref(""),
  quarter: ref(""),
  month: ref(""),
  pageNum: 1,
  pageSize: 10
};
let totalSize = ref(10);


// 
const toLeadVisible = ref(false);
//fileFlag
const upLoadFileFlag = ref(false);
//toLeadForm 上传文件
let toLeadForm: FormData = new FormData();

const jumpDowmTemp = ()=>{
  window.location.href = baseURL + 'dsms/hg/downGdpTemplate';
}

const leadAddShow = () => {
    toLeadVisible.value = true;
    toLeadForm = new FormData();
    upLoadFileFlag.value = false;
}
const onFileChange = (fileList: any) => {
    if (fileList != null && fileList.length > 0) {
        upLoadFileFlag.value = true; //by guo 2020-8-4-15:18添加
        toLeadForm = new FormData();
        toLeadForm.append("file", fileList[0].file);
    } else {
        upLoadFileFlag.value = false; //by guo 2020-8-4-15:18添加
        toLeadForm = new FormData();
    }
};
const toLeadOk = async () => {
    if (upLoadFileFlag.value) {
    } else {
        Message.error("请选择文件");
        toLeadVisible.value = true;
    }
};


const addvisible = ref(false);
const addDataForm = {
  area: ref(""),
  statisticalTimeType: ref(1),
  statisticalYear: ref(""),
  statisticalQuarter: ref(""),
  statisticalMonth: ref(""),
  industryCategory: ref(""),
  industry: ref(""),
  gdp: ref(0),
  ranking: ref(0),
  growthGdp: ref(0),
  amount: ref(0),
  iquantity: ref(0),
  perCapitaValue: ref(0),
  perCapitaRanking: ref(0),
  iamount: ref(0),
  iiquantity: ref(0),
  pullingRate: ref(0),
  pullingRateRanking: ref(0),
  entryDepartment: ref(""),
  creator: ref(""),
}
const handleAddOk = async () => {
  if (addDataForm.area.value == null || addDataForm.area.value == "") {
    Message.error("请选择县市区");
    return false;
  }
  console.log(addDataForm);
  let res = await postRequest("dsms/hgGdp/dataAdd", {
    area:addDataForm.area.value,
    areaLevel: addDataForm.area.value == "黄冈市"?1:2,
    industryCategory:addDataForm.industryCategory.value,
    industry:addDataForm.industry.value,
    gdp:addDataForm.gdp.value,
    ranking:addDataForm.ranking.value,
    growthGdp:addDataForm.growthGdp.value,
    amount:addDataForm.amount.value,
    iquantity:addDataForm.iquantity.value,
    pullingRate:addDataForm.pullingRate.value,
    pullingRateRanking:addDataForm.pullingRateRanking.value,
    entryDepartment:addDataForm.entryDepartment.value,
    creator: addDataForm.creator.value,
    statisticalTimeType:addDataForm.statisticalTimeType.value,
    statisticalQuarter:addDataForm.statisticalQuarter.value,
    statisticalMonth:addDataForm.statisticalMonth.value,
    statisticalYear:addDataForm.statisticalYear.value
  });
  console.log(res);
  // renderData.value = res.list;
  totalSize.value = Number(res.total);
}

const addDataShowFun = () => {
  addvisible.value = true;
}
const handleCancel = () => {
  addvisible.value = false;
}


const editvisible = ref(false);


const editDataForm = {
  id: 0,
  area: ref(""),
  statisticalTimeType: ref(1),
  statisticalYear: ref(""),
  statisticalQuarter: ref(""),
  statisticalMonth: ref(""),
  industryCategory: ref(""),
  industry: ref(""),
  gdp: ref(0),
  ranking: ref(0),
  growthGdp: ref(0),
  amount: ref(0),
  iquantity: ref(0),
  perCapitaValue: ref(0),
  perCapitaRanking: ref(0),
  iamount: ref(0),
  iiquantity: ref(0),
  pullingRate: ref(0),
  pullingRateRanking: ref(0),
  entryDepartment: ref(""),
  creator: ref(""),
  
}
const handleEditOk = async () => {
  if (editDataForm.area.value == null || editDataForm.area.value == "") {
    Message.error("请选择县市区");
    return false;
  }
  console.log(editDataForm);
  let res = await postRequest("dsms/hgGdp/dataUpdate", {
    id:editDataForm.id,
    area:editDataForm.area.value,
    areaLevel: editDataForm.area.value == "黄冈市"?1:2,
    industryCategory:editDataForm.industryCategory.value,
    industry:editDataForm.industry.value,
    gdp:editDataForm.gdp.value,
    ranking:editDataForm.ranking.value,
    growthGdp:editDataForm.growthGdp.value,
    amount:editDataForm.amount.value,
    iquantity:editDataForm.iquantity.value,
    iamount:editDataForm.iamount.value,
    iiquantity:editDataForm.iiquantity.value,
    pullingRate:editDataForm.pullingRate.value,
    pullingRateRanking:editDataForm.pullingRateRanking.value,
    entryDepartment:editDataForm.entryDepartment.value,
    creator: editDataForm.creator.value,
    statisticalTimeType:editDataForm.statisticalTimeType.value,
    statisticalQuarter:editDataForm.statisticalQuarter.value,
    statisticalMonth:editDataForm.statisticalMonth.value,
    statisticalYear:editDataForm.statisticalYear.value
  });
  console.log(res);
  // renderData.value = res.list;
  totalSize.value = Number(res.total);
}

function editItem(record: any) {
  editvisible.value = true;
  editDataForm.id = record.id;
  editDataForm.area.value = record.area;
  editDataForm.statisticalTimeType.value = record.statisticalTimeType;
  editDataForm.statisticalYear.value = record.statisticalYear;
  editDataForm.statisticalQuarter.value = record.statisticalQuarter;
  editDataForm.statisticalMonth.value = record.statisticalMonth;
  editDataForm.industryCategory.value = record.industryCategory;
  editDataForm.industry.value = record.industry;
  editDataForm.gdp.value = record.gdp;
  editDataForm.ranking.value = record.ranking;
  editDataForm.growthGdp.value = record.growthGdp;
  editDataForm.amount.value = record.amount;
  editDataForm.iquantity.value = record.iquantity;
  editDataForm.perCapitaValue.value = record.perCapitaValue;
  editDataForm.perCapitaRanking.value = record.perCapitaRanking;
  editDataForm.iamount.value = record.iamount;
  editDataForm.iiquantity.value = record.iiquantity;
  editDataForm.pullingRate.value = record.pullingRate;
  editDataForm.pullingRateRanking.value = record.pullingRateRanking;
  editDataForm.entryDepartment.value = record.entryDepartment;
  editDataForm.creator.value = record.creator;


};



let renderData: any[] = [
  {
    "industryCategory": "农林牧渔",
    "area": "黄冈市",
    "quantity": 18807,
    "growthGdp": 7.2,
    "amount": "6.3",
    "iquantity": 14611,
    "iamount": "77.69",
    "iRank": "",
    "pullingRate": "1.2",
    "creator": "李统计",
    "entryDepartment": "统计局",
    "statisticalYear": "2024",
    "statisticalTimeType": 1,
  },
  {
    "industryCategory": "农林牧渔",
    "area": "黄州区",
    "quantity": 186258,
    "growthGdp": 7.2,
    "amount": "6.3",
    "iquantity": 178368,
    "iamount": "95.76",
    "iRank": "1",
    "pullingRate": "1.2",
    "creator": "李统计",
    "entryDepartment": "统计局",
    "statisticalYear": "2024",
    "statisticalTimeType": 1,
  },
  {
    "industryCategory": "工业",
    "area": "团风县",
    "quantity": 444166,
    "growthGdp": 18.6,
    "amount": "5.6",
    "iquantity": 423965,
    "iamount": "95.45",
    "iRank": "2",
    "pullingRate": "2.5",
    "creator": "王统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 2,
    "statisticalQuarter": "2",
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "建筑业",
    "area": "红安县",
    "quantity": 692308,
    "growthGdp": 9.1,
    "amount": "5.2",
    "iquantity": 654657,
    "iamount": "94.56",
    "iRank": "3",
    "pullingRate": "1.8",
    "creator": "张统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 3,
    "statisticalMonth": "1",
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "批发和零售业",
    "area": "麻城市",
    "quantity": 1582248,
    "growthGdp": 12.3,
    "amount": "5.9",
    "iquantity": 1526002,
    "iamount": "96.45",
    "iRank": "4",
    "pullingRate": "2.1",
    "creator": "刘统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 1,
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "住宿和餐饮业",
    "area": "罗田县",
    "quantity": 1017221,
    "growthGdp": 4.7,
    "amount": "5.4",
    "iquantity": 965849,
    "iamount": "94.95",
    "iRank": "5",
    "pullingRate": "0.9",
    "creator": "陈统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 1,
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "交通运输业",
    "area": "英山县",
    "quantity": 503692,
    "growthGdp": 3.5,
    "amount": "6.1",
    "iquantity": 448131,
    "iamount": "88.97",
    "iRank": "6",
    "pullingRate": "0.6",
    "creator": "赵统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 1,
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "金融业",
    "area": "浠水县",
    "quantity": 1182509,
    "growthGdp": 8.9,
    "amount": "6.3",
    "iquantity": 1119659,
    "iamount": "94.69",
    "iRank": "7",
    "pullingRate": "1.5",
    "creator": "周统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 1,
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "房地产业",
    "area": "蕲春县",
    "quantity": 981174,
    "growthGdp": 7.4,
    "amount": "6.0",
    "iquantity": 944120,
    "iamount": "96.22",
    "iRank": "8",
    "pullingRate": "1.3",
    "creator": "吴统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 1,
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "其他服务业",
    "area": "武穴市",
    "quantity": 754540,
    "growthGdp": 6.2,
    "amount": "5.9",
    "iquantity": 699904,
    "iamount": "92.76",
    "iRank": "9",
    "pullingRate": "1.1",
    "creator": "孙统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 1,
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "其他服务业",
    "area": "黄梅县",
    "quantity": 965508,
    "growthGdp": 6.2,
    "amount": "5.9",
    "iquantity": 935611,
    "iamount": "96.90",
    "iRank": "10",
    "pullingRate": "1.1",
    "creator": "孙统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 1,
    "statisticalYear": "2024"
  },
  {
    "industryCategory": "其他服务业",
    "area": "合计",
    "quantity": 83284318,
    "growthGdp": 6.2,
    "amount": "5.9",
    "iquantity": 7910877,
    "iamount": "94.99",
    "iRank": "",
    "pullingRate": "1.1",
    "creator": "孙统计",
    "entryDepartment": "统计局",
    "statisticalTimeType": 1,
    "statisticalYear": "2024"
  },
];
// let renderData = ref<any[]>([]);
// const fetchData = async () => {
//   let res = await postRequest("dsms/hgGdp/gdpDataQuery", {
//     area:formModel.area.value,
//     industryCategory:formModel.industryCategory.value,
//     pageNum: formModel.pageNum
//   });
//   console.log(res);
//   renderData.value = res.list;
//   totalSize.value = Number(res.total);
// }
// function jumpPage(val: any) {
//   formModel.pageNum = val;
//   fetchData();
// }
// fetchData();
</script>
<script lang="ts">
export default {
  name: 'communityParty',
};
</script>

<style scoped lang="less">
.container {
  padding: 0 20px 20px 20px;
}

.rate {
  font-size: 15px;
}

::v-deep(.arco-rate-character:not(:last-child)) {
  margin-right: 1px;
}
::v-deep(.arco-form-item){
  margin-bottom: 10px;
}
</style>